<?php
require_once("../../cofd/common.php");
$id = $_GET['id'];
$sql = "SELECT refuse FROM novel WHERE name='$id'";
$result = $conn -> query($sql);
$row = $result -> fetch_assoc();
$zt = $row['refuse'];
if($zt == '1'){
    $sql = "UPDATE novel SET refuse=0 WHERE name='".$id."'";
}else{
    $sql = "UPDATE novel SET refuse=1 WHERE name='".$id."'";
}
if($conn -> query($sql)){
    echo json_encode(array("code"=>200,"msg"=>"修改成功"));
}
else{
    echo json_encode(array("code"=>400,"msg"=>"修改失败"));
}
$conn -> close();